/**
 *
 */
package org.jprobe.codegen;

/**
 * implementation of BeanGetterValueInterface
 * @author Hussain Al-Mutawa
 * @version 1.0
 * @since 1.0
 */
public class BeanGetterValue implements BeanGetterValueInterface {
	/** the value returned by calling a member **/
	private transient Object value;
	/** the exception thrown during execution of a member **/
	private transient String exceptionThrown;
	/** initializes the bean getter value and assigns the exception thrown to {@link BeanGetterValueInterface#NO_EXCEPTION} **/
	public BeanGetterValue() {
		super();
		this.exceptionThrown=NO_EXCEPTION;
	}

	@Override
	public Object getValue() {
		return value;
	}

	@Override
	public String getExceptionThrown() {
		return exceptionThrown;
	}

	@Override
	public void setValue(final Object value) {
		this.value=value;
	}

	@Override
	public void setExcepionThrown(final String excepionThrown) {
		this.exceptionThrown=excepionThrown;
	}
	/**
	 * overrides {@link java.lang.Object#toString()}
	 * @return the value of he getter casted to string
	 */
	@Override
	public String toString() {
		return ""+value;
	}
}
